// ClientSocket.cpp : implementation file
//

#include "stdafx.h"

#include "..\MFCSocket_Client\MFCSocketDlg_Client.h"
#include "ClientSocket.h"

// ClientSocket

ClientSocket::ClientSocket()
{
}

ClientSocket::~ClientSocket()
{
}


// ClientSocket member functions

void ClientSocket::OnAccept(int nErrorCode)
{
	OutputDebugString(_T("[Client socket]: OnAccept"));

	CSocket::OnAccept(nErrorCode);
}
static char k='0';
void ClientSocket::OnReceive(int nErrorCode)
{
	OutputDebugString(_T("[Client socket]: OnReceive"));
	char buff[256];
	int br=Receive(buff,256);
	CString s(buff);
	AfxMessageBox(s);
	
	/*
	k++;
	buff[br]=(char)k;
	buff[br+1]='\0';
	*/
	((CMFCSocketDlg_Client*)pDlg)->SocketReceiveMessage(buff);
	//((CMFCSocketDlg_Client)hwnd).SocketReceiveMessage(buff);
	//((CMFCSocketDlg_Client*)pDlg)->SocketReceiveMessage(buff);
	/*
	CString s;
	s.Format(_T("--- Message: %s"),buff);
	*/
	OutputDebugStringA(buff);
	CSocket::OnReceive(nErrorCode);
}
